home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-02-24 | 450 b | 22 lines | [TEXT/????] |
- /*
- * Copyright (c) 1992 David I. Bell
- * Permission is granted to use, distribute, or modify this source,
- * provided that this copyright notice remains intact.
- *
- * Function to find the next prime (probably).
- */
-
- define nextprime(n, tries)
- {
- if (isnull(tries))
- tries = 20;
- if (iseven(n))
- n++;
- while (ptest(n, tries) == 0)
- n += 2;
- return n;
- }
-
- global lib_debug;
- if (!isnum(lib_debug) || lib_debug>0) print "nextprime(n, tries) defined";
-